from pydantic import BaseModel, Field
from typing import Optional


class ItemCreate(BaseModel):
    title: str = Field(..., max_length=100)
    owner_id: int


class ItemUpdate(ItemCreate):
    pass


class ItemResponse(BaseModel):
    id: int
    title: str
    owner_id: int

    class Config:
        from_attributes = True